Skip to main content

A real-time cryptocurrency trading dashboard powered by AI agents with multi-exchange support

Project description

HashTrade

A real-time cryptocurrency trading dashboard powered by Strands Agents with AI-driven trading assistance, multi-exchange support via CCXT, and dynamic UI customization.

๐Ÿš€ Try the Live Dashboard | ๐Ÿ“ฆ Install from PyPI

HashTrade Dashboard Python 3.11+ PyPI version License Dashboard

โœจ Features

  • ๐Ÿค– AI Trading Assistant - Natural language interface for trading operations
  • ๐Ÿ“Š Real-time Market Data - Live OHLCV charts with WebSocket streaming
  • ๐Ÿ’ฑ Multi-Exchange Support - Bybit, Binance, OKX, KuCoin, Kraken, Coinbase, and 100+ more via CCXT
  • ๐ŸŽจ Dynamic Theming - 7 built-in themes + custom color picker
  • ๐Ÿ“œ Action History - Persistent timeline of trades, signals, and events
  • ๐Ÿ”ง Dynamic UI Rendering - Agent can render cards, tables, charts, alerts on-the-fly
  • โšก WebSocket Streaming - Real-time agent responses with tool execution visibility

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     HashTrade Dashboard                          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Frontend (docs/index.html)                                     โ”‚
โ”‚  โ”œโ”€โ”€ Market Graph (OHLCV Chart)                                 โ”‚
โ”‚  โ”œโ”€โ”€ History of Actions (Timeline)                              โ”‚
โ”‚  โ”œโ”€โ”€ Agent Screen (Chat with streaming)                         โ”‚
โ”‚  โ””โ”€โ”€ Theme Customization                                        โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  WebSocket Server (server/main.py)                              โ”‚
โ”‚  โ”œโ”€โ”€ Strands Agent with callback streaming                      โ”‚
โ”‚  โ”œโ”€โ”€ Direct CCXT for UI actions (fast path)                     โ”‚
โ”‚  โ””โ”€โ”€ History sync & persistence                                 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Tools                                                           โ”‚
โ”‚  โ”œโ”€โ”€ use_ccxt - Universal exchange interface                    โ”‚
โ”‚  โ”œโ”€โ”€ history  - Action logging & persistence                    โ”‚
โ”‚  โ””โ”€โ”€ interface - Dynamic UI & theme control                     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿš€ Quick Start

Installation

# Install from PyPI
pip install hashtrade

# Or clone the repository
git clone https://github.com/mertozbas/hashtrade.git
cd hashtrade

# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install in development mode
pip install -e .

Configuration

Set your model provider (choose one):

# AWS Bedrock (recommended)
export MODEL_PROVIDER=bedrock
# Requires AWS credentials configured

# Anthropic
export MODEL_PROVIDER=anthropic
export ANTHROPIC_API_KEY=your_key

# OpenAI
export MODEL_PROVIDER=openai
export OPENAI_API_KEY=your_key

# Ollama (local, free)
export MODEL_PROVIDER=ollama
export STRANDS_MODEL_ID=qwen3:1.7b

Set exchange credentials (optional, for trading):

# Generic CCXT credentials
export CCXT_EXCHANGE=bybit
export CCXT_API_KEY=your_api_key
export CCXT_SECRET=your_api_secret

# Or exchange-specific
export BYBIT_API_KEY=your_api_key
export BYBIT_API_SECRET=your_api_secret

Running

# Start the server
python server/main.py

# Or use the CLI command
hashtrade

Then open the HashTrade in your browser and click Connect.

๐Ÿ’ฌ Usage Examples

Natural Language Trading

"buy 0.001 BTC"           โ†’ Creates market buy order
"sell 100 USDT of ETH"    โ†’ Market sell
"limit buy BTC at 50000"  โ†’ Limit order
"check balance"           โ†’ Shows account balances
"price of ETH"            โ†’ Gets current ticker
"show me ETH/USDT chart"  โ†’ Fetches OHLCV data

Theme Customization

"change to cyberpunk theme"      โ†’ Magenta/cyan theme
"make it blue"                   โ†’ Ocean blue theme
"I want gold colors"             โ†’ Gold luxury theme
"change accent color to purple"  โ†’ Custom accent color

Dynamic UI

The agent can render interactive components:

"show me a table of top 10 coins"
"display a progress bar for my portfolio"
"create an alert for when BTC hits 70000"

๐Ÿ› ๏ธ Tools Reference

use_ccxt

Universal CCXT client for cryptocurrency exchange operations.

Actions:

Action Description Required Params
list_exchanges List all 100+ supported exchanges -
describe Get exchange capabilities exchange
fetch_ticker Get ticker for symbol symbol
fetch_ohlcv Get OHLCV candles symbol, timeframe, limit
fetch_balance Get account balance -
create_order Create new order symbol, side, order_type, amount
cancel_order Cancel existing order order_id
multi_orderbook Compare orderbooks across exchanges exchanges, symbol

Example:

use_ccxt(
    action="create_order",
    exchange="bybit",
    symbol="BTC/USDT",
    side="buy",
    order_type="limit",
    amount=0.001,
    price=50000
)

history

Persist and fetch dashboard action history.

Actions:

Action Description Params
add Add history entry event_type, data
tail Get recent entries limit
clear Clear all history -

Event Types: order, trade, signal, note, theme

interface

Dynamic UI rendering and theme control.

Theme Actions:

Action Description Params
set_theme Apply preset theme preset
update_color Change single color color_name, color_value
list_presets List available themes -
reset_theme Reset to default -

Preset Themes:

  • neon_green (default)
  • cyberpunk (magenta/cyan)
  • ocean_blue (blue/teal)
  • sunset_orange (orange/amber)
  • gold_luxury (gold/black)
  • matrix_green (pure green)
  • dark_minimal (white/gray)

UI Render Actions:

Action Description Params
render_card Styled card component title, content
render_table Data table title, data
render_chart Bar chart widget title, data
render_alert Toast notification content, style
render_progress Progress indicator title, data
render_html Raw HTML injection html
clear_ui Clear dynamic components target

๐Ÿ“ Project Structure

hashtrade/
โ”œโ”€โ”€ server/
โ”‚   โ”œโ”€โ”€ main.py              # WebSocket server & agent
โ”‚   โ”œโ”€โ”€ data/
โ”‚   โ”‚   โ””โ”€โ”€ history.jsonl    # Persisted history (auto-created)
โ”‚   โ””โ”€โ”€ tools/
โ”‚       โ”œโ”€โ”€ use_ccxt.py      # CCXT exchange tool
โ”‚       โ”œโ”€โ”€ history.py       # Action history tool
โ”‚       โ””โ”€โ”€ interface.py     # UI/theme tool
โ”œโ”€โ”€ docs/
โ”‚   โ””โ”€โ”€ index.html           # Dashboard frontend (GitHub Pages)
โ”œโ”€โ”€ pyproject.toml           # Package configuration
โ””โ”€โ”€ README.md

โš™๏ธ Configuration Options

Environment Variables

Variable Description Default
DASH_HOST Server bind host 127.0.0.1
DASH_PORT Server port 8090
DASH_EXCHANGE Default exchange bybit
DASH_DATA_DIR Data directory ./data
DASH_CUSTOM_PROMPT Custom system prompt -
DASH_CUSTOM_PROMPT_FILE Path to custom prompt file -
MODEL_PROVIDER LLM provider auto-detect
STRANDS_MODEL_ID Model identifier provider-specific
CCXT_EXCHANGE Default exchange for CCXT -
CCXT_API_KEY API key -
CCXT_SECRET API secret -
CCXT_SANDBOX Enable sandbox mode false
CCXT_DEFAULT_TYPE Market type (spot/swap) -

Frontend Settings

The dashboard stores settings in localStorage:

  • Exchange selection
  • API credentials (stored locally only)
  • Symbol and timeframe
  • Live update interval
  • Theme preferences

๐Ÿ”’ Security Notes

  • API credentials are stored in browser localStorage only
  • Server logs redact sensitive information
  • Use sandbox/testnet mode for development: CCXT_SANDBOX=true
  • Never commit API keys to version control

๐Ÿงช Development

Running Tests

pip install -e ".[dev]"
pytest

Adding New Tools

  1. Create tool file in server/tools/
  2. Use @tool decorator from strands
  3. Import and add to agent in server/main.py
from strands import tool

@tool
def my_tool(action: str, param: str = None) -> dict:
    """Tool description for the agent."""
    # Implementation
    return {"status": "success", "content": [{"text": "result"}]}

Custom System Prompt

Create a file with your custom instructions:

export DASH_CUSTOM_PROMPT_FILE=/path/to/my_prompt.txt

Or set directly:

export DASH_CUSTOM_PROMPT="Always confirm orders. Focus on risk management."

๐Ÿ“„ License

Apache License 2.0

๐Ÿ™ Acknowledgments


#trade

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hashtrade-1.1.0.tar.gz (58.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hashtrade-1.1.0-py3-none-any.whl (36.1 kB view details)

Uploaded Python 3

File details

Details for the file hashtrade-1.1.0.tar.gz.

File metadata

  • Download URL: hashtrade-1.1.0.tar.gz
  • Upload date:
  • Size: 58.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for hashtrade-1.1.0.tar.gz
Algorithm Hash digest
SHA256 c6f2a471c277ae7272aa1503b1f0379c043b01c99db3925de2a45759947a5d51
MD5 d6bc00baaaddb1369338215f018cf9d4
BLAKE2b-256 bda7ad31f2a0d6e67b668fd786501a1a5c180aa6fff8c557dda99fff6eee32c1

See more details on using hashes here.

File details

Details for the file hashtrade-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: hashtrade-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 36.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for hashtrade-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36d607123d333e96ecb0d1b9c4ed95fb5b74bc6b40382c305184829b3542dffd
MD5 3d83d9b34ce9364d84f5d4e37cf505c2
BLAKE2b-256 af6bdf7ddd316b2cc059bdabcfee327d9f27a4b5d881b5f0528842b7101d4abc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page